Ext.define('Usws.view.channel.ChannelEdit', {
    extend: 'Ext.window.Window',
    xtype: 'Channel-Edit',
    title: '编辑频道信息',
    layout: 'hbox',
    autoShow: true,
    resize:false,
    modal: true,
    initComponent: function() {
        this.items = [
            {
                xtype: 'form',
                border: false,
                bodyPadding: 5,
                defaultType:'textfield',
                items: [
	                 {xtype: 'hiddenfield',name:'channel.uid',id: 'uid'}
	                ,{xtype: 'hiddenfield',name:'channel.isIdxChannel',id: 'isIdxChannel'}
	                ,{xtype: 'hiddenfield',name:'channel.picture',id: 'picture'}
	                ,{xtype: 'hiddenfield',name:'channel.platePicture',id: 'platePicture'}
	                ,{xtype: 'hiddenfield',name:'seqNum',id: 'seqNum'}
	                ,{xtype: 'hiddenfield',name:'channel.createByUid', id: 'createByUid'}
	                ,{xtype: 'hiddenfield',name:'createDate', id: 'createDate'}
					,{name:'channel.name', id: 'name', fieldLabel: '频道名称'}
					,{
                        xtype: 'combobox',
                        fieldLabel: '频道级别',
                        name: 'channel.parentUid',
                        id:'parentUid',
                        store: 'ChannelLevel',
                        valueField: 'uid',
                        displayField: 'name',
                        typeAhead: true,
                        editable:false,
                        queryMode:'local',
                        allowBlank:false
                    }
					,{
						    xtype: 'fieldcontainer',
					        fieldLabel: '频道图标',
					        layout: 'hbox',
					        items: [{
					        	xtype: 'filefield',
					        	name:'file',
					        	id: 'uploadChannelPic',
					        	buttonText:'选择',
					            margin:'0 60 0 0'
					        }
					        ]
					 }, 
					{
				            xtype: 'fieldcontainer',
				            fieldLabel: '开放角色',
				            layout: 'hbox',
				            defaultType: 'checkboxfield',
				            id:'targetRoleCheckBoxs',
				            items: [
				                {
				                	boxLabel  : '公共频道',
				                    inputValue: 4,
				                    id:'checkBox_public'
				                }, {
				                    boxLabel  : '学生',
				                    inputValue: 1,
				                    id:'checkBox_student'
				                }, {
				                    boxLabel  : '家长',
				                    inputValue: 2,
				                    id:'checkBox_parent'
				                }, {
				                    boxLabel  : '老师',
				                    inputValue: 8,
				                    id:'checkBox_teacher'
				                }
				            ]
				        },
					 {
						    xtype: 'fieldcontainer',
					        layout: 'vbox',
					        id: 'uiTypeSet',
					        items: [
					        {
					        	xtype: 'combobox',
		                        fieldLabel: '板块设置',
		                        name: 'channel.uiType',
		                        id:'uiType',
		                        store: 'DomainDict',
		                        valueField: 'sepId',
		                        displayField: 'name',
		                        emptyText:'请选择板块',
		                        typeAhead: true,
		                        editable:false,
		                        queryMode:'local'
					        },
					        {
					        	xtype: 'filefield',
					        	fieldLabel: '板块图片',
					        	name:'file',
					        	id: 'uploadPlatePic',
					        	buttonText:'选择',
					            margin:'0 60 0 0'
					        }
					       ]
					 }
					,{
						xtype: 'radiogroup',
			            fieldLabel: '频道类型',
			            layout: 'hbox',
			            id:'channel_videoType',
			            items: [
			                {
			                    boxLabel  : '普通频道',
			                    name      : 'channel.channelTypeDsid',
			                    inputValue: 1,
		                        id:'checkBox_normal'
			                }, {
			                    boxLabel  : '功能',
			                    name      : 'channel.channelTypeDsid',
			                    inputValue: 2,
			                    id:'checkBox_function'
			                }, {
			                    boxLabel  : '视频',
			                    name      : 'channel.channelTypeDsid',
			                    inputValue: 3,
			                    id:'checkBox_video'
			                }, {
			                    boxLabel  : '会议',
			                    name      : 'channel.channelTypeDsid',
			                    inputValue: 4,
			                    id:'checkBox_metting'
			                }
			            ]
					}
					,{
						xtype: 'fieldcontainer',
			            layout: 'vbox',
			            id:'video_type3',
			            items:[
			                   {
			                	   xtype: 'fieldcontainer',
						           fieldLabel: '关联类别',
						           layout: 'hbox',
						           items:[
						                  {
						                	xtype: 'treepanel',
						                	store: 'ChannelRelateCat',
						                	useArrows: true,
					                	    rootVisible: false,
					                	    titleCollapse: true,
					                	    emptyText:'暂无可关联类别',
					                	    width: 250,
					                	    height: 100,
					                	    id:'channelRelateCatTree'
						                  }
						            ]
			                   },
			                   {
			                	    xtype: 'fieldcontainer',
						            defaultType: 'checkboxfield',
						            fieldLabel: '视频性质',
						            layout: 'hbox',
						            id:'videoQualityBoxs',
						            items: [
						                {
						                    boxLabel  : '正片',
						                    inputValue: 1,
						                    id  : 'videoQuality1'
						                }, {
						                    boxLabel  : '预告片',
						                    inputValue: 2,
						                    id  : 'videoQuality2'
						                }
						            ]
			                   },
			                   {
			                	    xtype: 'fieldcontainer',
						            defaultType: 'checkboxfield',
						            fieldLabel: '视频来源',
						            layout: 'hbox',
						            id:'videoFromBoxs',
						            items: [
						                {
						                    boxLabel  : '后台运营',
						                    inputValue: 1,
						                    id:'videoFrom1'
						                }, {
						                    boxLabel  : '用户上传 ',
						                    inputValue: 2,
						                    id:'videoFrom2'
						                }
						            ]
			                   }
			                ]
			         }
					,{
						xtype: 'fieldcontainer',
			            layout: 'vbox',
			            id:'video_type4',
			            items:[
			                   {
			                	    xtype: 'fieldcontainer',
						            fieldLabel: '会议类型',
						            layout: 'hbox',
						            defaultType: 'checkboxfield',
						            id:'mettingTypeBoxs',
						            items: [
						                {
						                    boxLabel  : '在线辅导',
						                    inputValue: 1,
						                    id:'mettingType1'
						                }, {
						                    boxLabel  : '网络教室',
						                    inputValue: 2,
						                    id:'mettingType2'
						                }, {
						                    boxLabel  : '家长会议',
						                    inputValue: 4,
						                    id:'mettingType4'
						                }, {
						                    boxLabel  : '家长访谈',
						                    inputValue: 8,
						                    id:'mettingType8'
						                }
						            ]
			                   },
			                   {
			                	    xtype: 'fieldcontainer',
						            layout: 'hbox',
						            defaultType: 'checkboxfield',
						            fieldLabel: '会议状态',
						            layout: 'hbox',
						            id:'mettingStatusBox',
						            items: [
						                {
						                    boxLabel  : '预约中',
						                    inputValue: 1,
						                    id:'mettingStatus1'
						                }, {
						                    boxLabel  : '会议中',
						                    inputValue: 2,
						                    id:'mettingStatus2'
						                }, {
						                    boxLabel  : '已结束',
						                    inputValue: 4,
						                    id:'mettingStatus4'
						                }
						            ]
			                   }
			                ]
			         }
					,{name:'channel.description', id: 'description', fieldLabel: '备注'}
					,{
                	    xtype: 'radiogroup',
			            fieldLabel: '状态',
			            layout: 'hbox',
			            items: [
			                {
			                    boxLabel  : '未启用',
			                    name      : 'channel.isValid',
			                    inputValue: 'N',
			                    id:'isValid',
			                    margin:'0 10 0 0'
			                }, {
			                    boxLabel  : '启用',
			                    name      : 'channel.isValid',
			                    inputValue: 'Y',
			                    checked:true
			                }
			            ]
	                   }
                ]
            },
            
            {
                xtype: 'panel',
                border: false,
                bodyPadding: 10,
                layout:'vbox',
                items: [
					        {
					        	xtype:'panel',
					        	id:'previewChannelPicPanel',
					        	border: false,
					        	items:[
										{
										    xtype: 'displayfield',
										    fieldLabel: '预览频道图片'
										},
										{
 											xtype: 'panel',
 								        	border:false,
 										    width:80,
 										    height:60,
 										    id:'previewChannelPic',
 										    html:'<img src="/images/no_pic.gif" width="80" height="60"/>'
 										}
					        	      ]
					        	
					        },
					        {
					        	xtype:'panel',
					        	id:'previewPlatePicPanel',
					        	border: false,
					        	items:[
										{
										    xtype: 'displayfield',
										    fieldLabel: '预览板块图片'
										},
										{
 											xtype: 'panel',
 								        	border:false,
 										    width:80,
 										    height:60,
 										    id:'previewPlatePic',
 										    html:'<img src="/images/no_pic.gif" width="80" height="60"/>'
 										}
					        	   ]
					        }
                ]
            },
            
            {
                xtype: 'panel',
                margin: '10 10 10 10',
                border:false,
                layout:'vbox',
                id:'plateDistribution',
                items: [
					        {
					            xtype: 'displayfield',
					            fieldLabel: '板块分布'
					        }
					        ,
					        {
					        	xtype: 'panel',
					        	layout: 'column',
					        	border:false,
					        	html:'<table style="border:1px solid #C2C2C2;text-align:center" cellspacing="0" cellpadding="0"><tr>'
			                        +'<td style="border:1px solid #C2C2C2; height:25px; width:50px">LOGO</td>'
			                        +'<td style="border:1px solid #C2C2C2; height:25px; width:50px" id="plate1">1</td>'
			                        +'<td rowspan="2" style="border:1px solid #C2C2C2;width:80px">重点推荐 <br />图片</td>'
			                        +'<td style="border:1px solid #C2C2C2; height:25px; width:50px"  id="plate5">5</td>'
			                        +'</tr><tr>'
			                        +'<td style="border:1px solid #C2C2C2; height:25px; width:50px" id="plate2">2</td>'
			                        +'<td style="border:1px solid #C2C2C2; height:25px; width:50px" id="plate3">3</td>'
			                        +'<td style="border:1px solid #C2C2C2; height:25px; width:50px" id="plate6">6</td>'
			                        +'</tr><tr>'
			                        +'<td colspan="2" style="border:1px solid #C2C2C2; height:25px;" id="plate4">4</td>'
			                        +'<td style="border:1px solid #C2C2C2; height:25px; width:80px" id="plate8">8</td>'
			                        +'<td style="border:1px solid #C2C2C2; height:25px; width:50px" id="plate7">7</td>'
			                        +'</tr></tr></table>'
					        }
			
                ]
            }
        ];

        this.buttons = [
            {
                text: '确定',
                action: 'save'
            },
            {
                text: '取消',
                scope: this,
                handler: this.close
            }
        ];
        
        this.callParent(arguments);
    }
});